# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-print-color
pkgver=0.4.6
pkgrel=0
pkgdesc="A simple Python wrapper to print color messages in the terminal"
url="https://github.com/xy3/print-color"
arch="noarch"
license="Apache-2.0"
makedepends="py3-gpep517 py3-poetry-core"
checkdepends="py3-pytest"
subpackages="$pkgname-doc $pkgname-pyc"
source="py3-print-color-$pkgver.tar.gz::https://github.com/xy3/print-color/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/print-color-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
d0c803a36069974f5e023237346781f4bd727bb7f177abe37a071dcc63dd12c9759f52278123f10270d583d2ac3ac857eefc96895671d6afe3bf4b33b6f38826  py3-print-color-0.4.6.tar.gz
"
